/***************************************************************************
 *   Copyright (C) 2009 - Jared Kells <jkells@gmail.com                    *
 *   Copyright (C) 2010 - 小贱  huaihuaixiaoshao@gmail.com                  *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 ***************************************************************************/

#ifndef KONSOLEAPPLET_H
#define KONSOLEAPPLET_H


#include <plasma/applet.h>
#include <QGraphicsSceneResizeEvent>
#include <QSize>
#include <kparts/part.h>
#include <kconfiggroup.h>
#include <KAboutData>
#include <KAboutApplicationDialog>
#include <KIcon>
#include <kde_terminal_interface.h>

/* Forward Declarations */
namespace KParts
{
	class ReadOnlyPart;
	class PartManager;
}

class KonsoleApplet : public Plasma::Applet
{
    Q_OBJECT
    public:
        KonsoleApplet(QObject *parent, const QVariantList &args);
        ~KonsoleApplet();
	void init();
	
	QList<QAction *> contextualActions () { return m_actions; }

    private:
	KParts::ReadOnlyPart* m_konsolePart;
	KParts::PartManager* m_partManager;
	
	QSize m_geometry;
	QList<QAction *> m_actions;
	KAboutData *m_aboutData;

	void loadConfiguration ();
	void saveConfiguration ();
    private slots:
      void about () const;
      bool setupTerm(QGraphicsProxyWidget *proxy);
      void mydebug();
    protected:
      void resizeEvent(QGraphicsSceneResizeEvent *event);
};



#endif
